#! /bin/bash
#! /run/current-system/sw/bin/bash

kdialog --title "KWin X11" --icon=/home/sny/.icons/xmonad.png --yesnocancel "Switch to KWin X11 or restart Plasma Desktop?" --cancel-label "Restart Plasma"

case $? in
    0)
		kill -9 $(pidof picom)
    	kill -9 $(pidof xmonad-x86_64-linux)
    	sleep 1s
		kquitapp5 plasmashell
		kstart5 plasmashell
    	sleep 1s
    	kwin_x11 &
    	sleep 1s
    	qdbus org.kde.kglobalaccel /kglobalaccel blockGlobalShortcuts false        
    ;;

    2) kquitapp5 plasmashell && kstart5 plasmashell
esac

exit
